<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>selectSort</title>
</head>
<body>
<script>
    function selectSort(arr) {
        for(var i=0;i<arr.length;i++){
            for(var j=i+1;j<arr.length;j++){
                if(arr[j]<arr[i]){
                    var temp=arr[i];
                    arr[i]=arr[j];
                    arr[j]=temp;
                }
            }
        }
        return arr;
    }
    var arr=[3,44,38,5,47,15,36,26,27,2,46,4,19,50,48];
    var a=selectSort(arr);
    console.log(a);
</script>
</body>
</html>